package org.schhx.session;

import org.schhx.config.XMLConfigBuilder;

import java.io.InputStream;

/**
 * @author shanchao
 * @date 2021/1/30
 */
public class SqlSessionFactoryBuilder {

    public static SqlSessionFactory build(InputStream inputStream) throws Exception {
        // 使用dom4j解析配置文件
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder();
        Configuration configuration = xmlConfigBuilder.parse(inputStream);

        return new DefaultSqlSessionFactory(configuration);
    }
}
